#include "stdafx.h"
#include "SDLGmud.h"

void SDLGmud::OnRender()
{
	//SDLSurface::OnDraw(Surf_Display, Surf_Test, 0, 0);
	//A test for restrict version of OnDraw
	//SDLSurface::OnDraw(Surf_Display, Surf_Test, 290, 210, 
	//				   0, Anim_Yoshi.GetCurrentFrame() * 64, 64, 64);
	GArea::AreaControl.OnRender(Surf_Display, 
		-GCamera::CameraControl.GetMapX(), 
		-GCamera::CameraControl.GetMapY());

	for(int i = 0; i < GEntity::EntityList.size(); i++)
	{
		if(!GEntity::EntityList[i])
			continue;

		GEntity::EntityList[i]->OnRender(Surf_Display);
	}

	SDL_Flip(Surf_Display);
}